<?php
/* Modovi - includes/login/login.php
   author: Modovi-Team (http://modovi.de/ | info@modovi.de)
   license: GNU General Public License v3 (http://www.gnu.org/licenses/gpl-3.0.html) */

/* $usernamepost = $_POST['username']; Get the POST from the form */
/* $passwordpost = $_POST['password']; Get the POST from the form */
$usernameget = $_GET['username']; // ONLY FOR TESTING
$passwordget = $_GET['password']; // ONLY FOR TESTING
$username = mysql_real_escape_string($usernameget); // Make the fields clean
$passwordclean = mysql_real_escape_string($passwordget); // Make the fields clean

$password = md5($passwordclean); // Create a md5 hash

$checkpassword = Database::Select("user", "password", "username = '$username'");

if($password == $checkpassword) {
	$_SESSION['modovi'] = true;
	$_SESSION['modovi_username'] = $username;
	// $_SESSION['modovi_userid'] = $getuserid;
	echo "Hi!";
}else{
	echo "False PWD!";
}
unset($checkpassword);
?>
